plugins {
    id 'java'
    id 'idea'
    id 'org.springframework.boot' version '3.0.5'
    id 'io.spring.dependency-management' version '1.1.0'
}
sourceCompatibility = '17'

configurations {
    compileOnly {
        extendsFrom annotationProcessor
    }
}

repositories {
    mavenCentral()
    maven {
        url "https://" + (System.getenv('CI_SERVER_HOST') ?: "gitlab.rampagemc.com") + "/api/v4/groups/41/-/packages/maven"
        name "GitLab"
        credentials(HttpHeaderCredentials) {
            name = 'Private-Token'
            value = findProperty("gitlab.rampage.token") ?: System.getenv("GITLAB_TOKEN_READ_CI")
        }
        authentication {
            header(HttpHeaderAuthentication)
        }
    }
}

ext {
    springDocVersion = '2.1.0'
    hibernateStructuresVersion = '3.3.1'
    mapStructVersion = '1.5.3.Final'
    mapStructLombokVersion = '0.2.0'
    logbookVersion = '3.3.0'
    backlibVersion = '0.4.2'
}

dependencies {

    implementation 'org.springframework.boot:spring-boot-starter-actuator'
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    implementation 'org.springframework.boot:spring-boot-starter-validation'
    implementation "io.hypersistence:hypersistence-utils-hibernate-60:${hibernateStructuresVersion}"
    implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$springDocVersion"

    implementation "com.rampagemc:backlib-rampage:$backlibVersion"

    implementation 'org.liquibase:liquibase-core'


    implementation "org.mapstruct:mapstruct:${mapStructVersion}"
    annotationProcessor "org.projectlombok:lombok-mapstruct-binding:${mapStructLombokVersion}"
    annotationProcessor "org.mapstruct:mapstruct-processor:${mapStructVersion}"


    compileOnly 'org.projectlombok:lombok'
    developmentOnly 'org.springframework.boot:spring-boot-devtools'
    runtimeOnly 'org.postgresql:postgresql'
    annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
    annotationProcessor 'org.projectlombok:lombok'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

test {
    useJUnitPlatform()
}

jar {
    enabled = false
}
